html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8f9fa;
}

/* 自定义颜色变量 */
:root {
  --primary-color: #667eea;
  --primary-hover: #5a6fd8;
  --success-color: #28a745;
  --info-color: #17a2b8;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

/* 全局样式 */
.bg-primary {
  background-color: var(--primary-color) !important;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* 卡片样式 */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  background-color: var(--light-color);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

/* 按钮样式 */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
}

/* 表单样式 */
.form-control,
.form-select {
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 导航栏样式 */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* 页脚样式 */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
  background-color: var(--light-color);
  border-top: 1px solid #dee2e6;
}

/* 聊天界面样式 */
.chat-container {
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
}

.chat-input {
  border-top: 1px solid #dee2e6;
  padding: 1rem;
  background-color: white;
}

.message-bubble {
  max-width: 80%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
}

.message-user {
  background-color: var(--primary-color);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 0.25rem;
}

.message-assistant {
  background-color: var(--light-color);
  color: var(--dark-color);
  margin-right: auto;
  border-bottom-left-radius: 0.25rem;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .lead {
    font-size: 1rem;
  }
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 工具提示样式 */
.tooltip {
  font-size: 0.875rem;
}

.tooltip-inner {
  background-color: var(--dark-color);
  border-radius: 0.25rem;
}

/* 徽章样式 */
.badge {
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
}

/* 进度条样式 */
.progress {
  height: 0.5rem;
  border-radius: 0.25rem;
  background-color: #e9ecef;
}

.progress-bar {
  border-radius: 0.25rem;
  transition: width 0.6s ease;
}

/* 列表组样式 */
.list-group-item {
  border: none;
  border-bottom: 1px solid #dee2e6;
  transition: background-color 0.2s ease;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background-color: var(--light-color);
}

.list-group-item-action:hover {
  background-color: rgba(102, 126, 234, 0.1);
}

/* 手风琴样式 */
.accordion-button {
  background-color: var(--light-color);
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(102, 126, 234, 0.25);
}

/* 警告框样式 */
.alert {
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  color: var(--info-color);
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* 表格样式 */
.table {
  border-radius: 0.5rem;
  overflow: hidden;
}

.table th {
  background-color: var(--light-color);
  border: none;
  font-weight: 600;
  color: var(--dark-color);
}

.table td {
  border: none;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}

/* 分页样式 */
.pagination {
  margin-bottom: 0;
}

.page-link {
  border: none;
  color: var(--primary-color);
  border-radius: 0.25rem;
  margin: 0 0.125rem;
}

.page-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* 模态框样式 */
.modal-content {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.75rem 0.75rem 0 0;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 0.75rem 0.75rem;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #dee2e6;
  }
}